Reasoning about Continuations with Control E ects
نویسنده
چکیده
We present a new static analysis method for rst-class continuations that uses an e ect system to classify the control domain behavior of expressions in a typed polymorphic language. We introduce two new control effects, goto and comefrom, that describe the control ow properties of expressions. An expression that does not have a goto e ect is said to be continuation following because it will always call its passed return continuation. An expression that does not have a comefrom effect is said to be continuation discarding because it will never preserve its return continuation for later use. Unobservable control e ects can be masked by the e ect system. Control e ect soundness theorems guarantee that the e ects computed statically by the e ect system are a conservative approximation of the dynamic behavior of an expression. The e ect system that we describe performs certain kinds of control ow analysis that were not previously feasible. We discuss how this analysis can enable a variety of compiler optimizations, including parallel expression scheduling in the presence of complex control structures, and stack allocation of continuations. The e ect system we describe has been implemented as an extension to the FX-87 programming language. This research was supported by the Defense Advanced Research Projects Agency of the Department of Defense and was monitored by the O ce of Naval Research under contract number N0001483-K-0125. CAI, Ecole des Mines, 60 bvd Saint-Michel, 75272, PARIS, France (E-mail: [email protected]) LCS, Massachusetts Institute of Technology, 545 Technology Square, Cambridge, MA 02139, USA (E-mail: [email protected]) Categories and Subject Descriptions: D.1.3 [Programming Techniques] { Concurrent Programming: E ect systems; D.1.m [Programming Techniques] { Miscellaneous: First-class continuations; D.3.1 [Programming Languages] { Formal De nitions and Theory; D.3.3 [Programming Languages] { Language Constructs: Control structures, e ect systems; D.3.4 [Programming Languages] { Processors: Compilers, optimization. General Terms: Languages, Theory, Veri cation. Additional
منابع مشابه
Reasoning about Therapy from a Physiological Model
In many medical domains a causal physiological model provides a knowledge base of relationships useful for reasoning about diagnosis, management, prognosis, and basic understanding of the processes. This paper reports on our e orts to develop algorithms for reasoning about the potential e ects of therapy in the context of a system designed to assist the physician in diagnosis and management of ...
متن کاملDirect E ects Causal Rules
We propose an approach to modeling delayed e ects of actions which is based on the use of causal constraints and their interaction with the direct e ects of actions The approach extends previous work with a causal approach used to deal with the rami cation problem We show the similarity between solutions to the modeling of indirect e ects and delayed e ects of actions by example The base logic ...
متن کاملThe Semantics of pcall and fork in the Presence of First-Class Continuations and Side-Effects
We present the semantics of the annotations pcall and fork for parallel evaluation of Scheme Annotated programs are proved to be behaviourly indistinguishable from their non annotated counterparts even in the presence of rst class continuations and side e ects The semantics takes the form of an abstract machine which can be regarded as a guideline for an implementation
متن کاملDelayed Eeects of Actions = Direct Eeects + Causal Rules Linkk Oping Electronic Articles in Computer and Information Science
We propose an approach to modeling delayed e ects of actions which is based on the use of causal constraints and their interaction with the direct e ects of actions The approach extends previous work with a causal approach used to deal with the rami cation problem We show the similarity between solutions to the modeling of indirect e ects and delayed e ects of actions by example The base logic ...
متن کاملControlling E ects
Many computational e ects, such as exceptions, state, or nondeterminism, can be conveniently speci ed in terms of monads. We investigate a technique for uniformly adding arbitrary such e ects to ML-like languages, without requiring any structural changes to the programs themselves. Instead, we use monadic re ection, a new language construct for explicitly converting back and forth between repre...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1989